<?php
get_header();
?>
  	
    <div class="wrapper">
        <?php get_sidebar(); ?>		 
		
        <div class="right-panel-outer">
            <div class="right-panel">
				<?php
				$slideshow_title = get_theme_option('slideshow','slideshow_title');
				$slideshow_type = get_theme_option('slideshow','slideshow_type');
				if($slideshow_type <> 'slideshow_type_noenable'): 
				?>
				
                <div class="right-inner">
                    <h2 class="head"><?php echo $slideshow_title;?></h2>
                    <div class="slider">
                        <?php require_once('slider/slider.php');?>
                    </div>
					<div class="clearfix"></div>
                </div>
                <div class="seperator"><img src="<?php echo SKIN_URI; ?>/star_bg.png" alt=""></div>
                <?php endif; ?>
				<?php 
				$assing_page_for_home_page=get_theme_option('general','assing_page_for_home_page');
				if($assing_page_for_home_page <> '') :
				$the_query =  get_page($assing_page_for_home_page  );
				 echo apply_filters('the_content', $the_query->post_content);  ?>
				<?php else: ?>
				
				<?php 
				
				if ( get_query_var('paged') ) {
                  	$paged = get_query_var('paged');
                  } elseif ( get_query_var('page') ) { 
                  	$paged = get_query_var('page');
                  } else {
                  	$paged = 1;
                  }
                  $posts_per_page = get_theme_option('blog','blog_post_per_page');
                  
                  $args = array(
                  	'post_type' => 'post',
                  	'posts_per_page' => $posts_per_page,
                  	'paged' => $paged 
                  );
                  if(is_page())
                  {
                      
                  	query_posts($args);
                  }else{
                  	global $wp_query;
                  	$query_args = array_merge( $wp_query->query, $args );
                  	global $posts;
                  	$posts=query_posts($query_args);
                  }
                  	
                  if(have_posts()):
				
				include_once('loop/loop-blog-1.php'); 
				endif;
				?>
				<?php endif; ?>
            </div>
            <div class="content-shadow">&nbsp;</div>
        </div>
        <div class="clearfix"></div>
    </div>
<?php
get_footer();
?>
